package com.yc.navy.blog.blog.service.Impl;

import com.yc.navy.blog.blog.bean.UserInfo;
import com.yc.navy.blog.blog.mapper.UserInfoMapper;
import com.yc.navy.blog.blog.service.IUserInfoService;
import com.yc.navy.blog.blog.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserInfoServiceImpl implements IUserInfoService {
    @Autowired
    private UserInfoMapper userInfoMapper;
    @Override
    public UserInfo login(UserInfo uf) {
       if (StringUtil.checknull(uf.getUname(),uf.getPwd())){
           return null;
       }
       return userInfoMapper.login(uf);
    }

    @Override
    public int reg(UserInfo uf) {
        if (StringUtil.checknull(uf.getUname(),uf.getPwd(),uf.getEmail())){
            return -100;
        }
        return userInfoMapper.reg(uf);
    }
}
